<?php
namespace app\common\model;


class Payment extends Model
{
    public $columns = [
        [  "type"=> self::TYPE_INT,  "column"=>"uid",  "memo"=>"uid", "length"=> 11 ],
        [  "type"=> self::TYPE_INT,  "column"=>"type",  "memo"=>"支付方式", "length"=> 11 ],
        [  "type"=> self::TYPE_VARCHAR,  "column"=>"payment_no",  "memo"=>"支付交易号", "length"=> 64 ],
        [  "type"=> self::TYPE_DECIMAL,  "column"=>"fee",  "memo"=>"价格", "length"=> 11 ],
        [  "type"=> self::TYPE_DECIMAL,  "column"=>"frozen_fee",  "memo"=>"冻结价格", "length"=> 11 ],
        [  "type"=> self::TYPE_TIMESTAMP,  "column"=>"pay_time",  "memo"=>"支付时间", "length"=> 11 ],
        [  "type"=> self::TYPE_TINYINT,  "column"=>"pay_status",  "memo"=>"支付状态", "length"=> 11 ],
        [  "type"=> self::TYPE_VARCHAR,  "column"=>"pay_memo",  "memo"=>"支付备注", "length"=> 255 ],
    ];

    static function paymentNo($key = "ORDER"){
        return sprintf("%s%s%s%s%s",date("YmhHis"),rand(1000,9999),"EE",$key,"FF");
    }
    static function paySuccess(){

    }
}